<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>分组列表</title>
<!--公共样式开始-->
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Css/reset.css">
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Css/common.css">
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Plugins/FontAwesome/css/font-awesome.min.css">
<!--公共样式结束-->
<!--公共JS开始-->
<script src="{$NOW_THEME_URL}/Assets/Js/jquery.min.js"></script>
<script src="{$NOW_THEME_URL}/Assets/Js/jquery.timer.js"></script>
<script src="{$NOW_THEME_URL}/Assets/Js/common.js"></script>
<!--公共JS结束-->
<!--数据列表插件开始-->
<link href="{$NOW_THEME_URL}/Assets/Plugins/ContextMenu/src/jquery.contextMenu.css" rel="stylesheet" type="text/css" />
<link href="{$NOW_THEME_URL}/Assets/Plugins/Etgrid/Css/etgrid.css" rel="stylesheet" type="text/css">
<script src="{$NOW_THEME_URL}/Assets/Plugins/ContextMenu/src/jquery.ui.position.js"></script>
<script src="{$NOW_THEME_URL}/Assets/Plugins/ContextMenu/src/jquery.contextMenu.js"></script>
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Plugins/Etgrid/Css/etgrid.css">
<script src="{$NOW_THEME_URL}/Assets/Plugins/Etgrid/Js/etgrid.js"></script>
<!--数据列表插件结束-->
<style type="text/css">
	body {
		overflow:hidden;
	}
	.table_box {
	}
</style>
</head>

<body>
<div class="page_header">
	<div class="table_tool">
		<ul class="clearfix">			
			<li class="openwin btn" etitle="新建分组" eheight="150px" ewidth="400px" ehref="{:U('Group/add')}" id="groupAdd"><i class="icon-plus"></i> 新建分组</li>
			<li class="line"></li>
			<li class="memberChart btn"><i class="icon-bar-chart"></i> 统计报表</li>
		</ul>
	</div>
</div>
	<div class="table_box">
	</div>
</body>
<script type="text/javascript">
	var listConfig = {
			blockBox : '.table_box',
			blockBoxHeight : 'window',
			jsonUrl : '__URL__/index',
			where : '',
			showPageNav: false,
			widthType : 'tdw', //thw-标题标准宽度、tdw-数据单元标准宽度、auto-随数据单元宽度
			pageNum : 10,
			nowPage : 1,
			orderName : "addtime",
			orderDirection : "desc",
			dataContextMenuOpen: true, //是否开启数据行右键菜单
			showPageNav: false,
			dataContextMenu: function(){
				$.contextMenu({
					selector: '.et_tbody tr',
					items: {
						"detail": {
							name: "查看组员", 
							icon: "remove",
							callback: function(key, options) {
								//alert
								var href   = "{:U('Group/groupMember')}&id="+$(this).attr('rowid');
								var width  = '700px';
								var height = '500px';
								var title  = '查看组员';
								openDialog('groupMember',href,width,height,title);
							}
						},
						"edit": {
							name: "修改", 
							icon: "edit",
							callback: function(key, options) {
								var href = "{:U('Group/edit')}&id="+$(this).attr('rowid');
								var width = '650px';
								var height = '500px';
								var title = '修改会员';
								openDialog('groupEdit',href,width,height,title);
							}
						},
						"delete": {
							name: "删除", 
							icon: "del",
							callback: function(key, options) {
								var id = $(this).attr('rowid');
								$.get("{:U('Group/del')}", { id: id },
									function(data){
										windowApi.lhgdialog.tips('数据删除成功！',1,etIcon.success,function(){
											//Ajax通讯成功后处理
											var width = '900px';
											var height = '500px';
											var title = '分组删除';
											openDialog('groupIndex',width,height,title);
										});
								});
																
								$('.et_tfoot .page_refresh').click(); //刷新加载
							}
						}
					}
				});
			},
			colModel : [
				{
					display : 'checkbox',
					name : 'id',
					sortable : true,
					myclass : 'center',
					edit : false
				},
				{
					display : '分组名称',
					name : 'title',
					sortable : true,
					myclass : 'center',
					edit : false
				},
				{
					display : '时间',
					name : 'addtime',
					sortable : true,
					myclass : 'center',
					edit : false
				}
			]
		};
	
	//实例化列表
	var tableList = $('.table_box').EtGrid(listConfig);
	//tableList.erefresh();
</script>
</html>
